perf: split the JavaScript bundle per route #193
+74
−38
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Splits the JavaScript per route, from the peer feedback (#167).
src/App.tsx: every page except the Elements page is loaded withReact.lazy, inside oneSuspensewith a visible, announced "Loading the page" fallback.docs/SUSTAINABILITY.mdare updated (they said 548 kB), and there is a short entry indocs/AI_USAGE.md.Why the Elements page is not lazy
/and the logo lead to it, so nearly every visit needs it. A first version made it lazy too, andApp.flow.test.tsxcaught a real problem: logging out on the Gymnasts page navigates to/elements; while that file downloaded, the protected page was still mounted and sent the visitor to/login.Checked
tsc, ESLint and Prettier are clean; the 426 frontend tests and all 57 end-to-end tests pass;npm run buildgives the numbers above. The first file is still a little over Vite's 500 kB warning, because the libraries are most of it. The gain on a real connection is measured in #157.Closes #176
🤖 Generated with Claude Code